home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 011 / pathmod.arc / PATHMOD.BAT
DOS Batch File  |  1986-06-12  |  3KB  |  119 lines

  1. echo off
  2. cls
  3. goto :FIRST
  4. ───────────────────────────────────────────────────────────────────────
  5. Ray Bernard   903 E. 8th St.  Anderson, IN 46012
  6. Messages care of RCN BBS South Bend, IN (219) 287-3358
  7. I wrote this batch file because I often make temporary directories
  8. on my RAM drive or hard disks.  This is an easy way to add the new drive
  9. to the path.  I keep my basic path in another batch file and use that to
  10. reset the path when I remove the temporary directory.
  11. Note: %PATH% will work from a batch file, but not on the command line.
  12. ───────────────────────────────────────────────────────────────────────
  13. :FIRST
  14. echo ───────────────────────────────────────────────────────────────────
  15. echo PATHMOD -- save, add to, restore your current path - by Ray Bernard
  16. echo ───────────────────────────────────────────────────────────────────
  17. echo     
  18. echo Evaluating parameters . . .
  19. echo     
  20. echo     
  21. goto START
  22.  
  23. :NOENTRY
  24. echo YOU MUST SPECIFY A PARAMETER FOR PATHADD:
  25. goto MESSAGE
  26.  
  27. :BAD
  28. echo Bad PARAMETERS: %1 %2.
  29. echo Parameters must be entered in ALL CAPS.
  30. echo     
  31.  
  32. :MESSAGE
  33. echo     
  34. ECHO Enter    PATHADD ?    to see documentation, or
  35. ECHO type or print out the PATHADD.BAT file.
  36. echo     
  37. goto END
  38.  
  39.  
  40. :START
  41. if "%1" == "" goto NOENTRY
  42. if "%1" == "SEMI" goto SEMI
  43. if "%1" == "SAVE" goto SAVE
  44. if "%1" == "RESTORE" goto RESTORE
  45. if "%1" == "ADD" goto ADD
  46. if "%1" == "?" goto TYPEFILE
  47. goto :BAD
  48. :ADD
  49. echo %path%>>pathrec.dat
  50. echo Your old path was:
  51. echo   %PATH%
  52. echo     
  53. echo It has been saved in the file PATHREC.DAT.
  54.  
  55. SET PATH=%PATH%%2
  56. echo     
  57. echo Your new path is:
  58. echo %PATH%
  59. goto END
  60.  
  61. :SAVE
  62. echo %path%>pathsave.dat
  63. echo Your current path is:
  64. echo   %PATH%
  65. echo     
  66. echo It has been saved in the file PATHSAVE.DAT.
  67. goto END
  68.  
  69. :RESTORE
  70. if exist PATHSAVE.DAT goto RSTORE
  71. echo Could not find the file PATHSAVE.DAT to restore your former path.
  72. echo     
  73. goto :END
  74. :RSTORE
  75. PATH=<PATHSAVE.DAT
  76. echo     
  77. echo Your path has been restored to:
  78. echo %PATH%
  79. echo     
  80. goto END
  81.  
  82. :SEMI
  83. echo Adding a semicolon and specified character string to the current path:
  84. echo     
  85. echo %path%>>pathrec.dat
  86. echo Your old path was:
  87. echo   %PATH%
  88. echo     
  89. set PATH=%PATH%;%2
  90. echo Path now = %PATH%
  91. echo     
  92. goto END
  93.  
  94. :TYPEFILE
  95. cls
  96. echo ──────────────────────────────────────────────────────────────────────────────
  97. echo USE PATHMOD.BAT to modify your current path.
  98. echo   
  99. echo Enter PATHMOD plus a parameter at the DOS prompt as explained below.
  100. echo Enter Parameter commands in ALL CAPS (not required of character string).
  101. echo  
  102. echo         ADD characterstring
  103. echo           - Displays current path, saves it to the file PATHSAVE.DAT,
  104. echo             adds your character string to the path and displays new path.
  105. echo             NOTE: DOS throws away a starting semicolon in the string.
  106. echo             If your current path does not end with a semicolon use SEMI.
  107. echo   
  108. echo         SEMI characterstring
  109. echo           - Adds semicolon plus character string to current path.
  110. echo   
  111. echo         SAVE
  112. echo           - Saves the current path by adding it to the file PATHREC.DAT
  113. echo             in the current directory.   Does not change current path.
  114. echo  
  115. echo         RESTORE
  116. echo           - Restores the path saved with SAVE, dislpays old and new path.
  117. echo ──────────────────────────────────────────────────────────────────────────────
  118. :END
  119.